package com.opc.controller;

import com.opc.service.ConsumeStatisticService;
import com.opc.utils.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 作者
 * @since 2023-04-03
 */
@RestController
@RequestMapping("/consumeStatistic")
@CrossOrigin("*")
public class ConsumeStatisticController {
    @Autowired
    private ConsumeStatisticService statisticService;

    @GetMapping("/list_month")
    public ApiResult getStatisticListMonth(@RequestParam(name = "type", defaultValue = "0", required = false) Integer type,
                                           @RequestParam(name = "proLine", required = false) String proLine,
                                           @RequestParam(name = "stationNum", required = false) String stationNum,
                                           @RequestParam(name = "deviceCode", required = false) String deviceCode) {
        return ApiResult.success(statisticService.getStatisticListMonth(type, proLine, stationNum, deviceCode));
    }

}
